package sort;

import java.util.Objects;

/**
 * @Author: Hugh
 * @Date: 2021/3/10
 */
public class Singleton {

    private static Singleton singleton;

    private Singleton(){}

    public Singleton getInstance(){
        if(Objects.isNull(singleton)){
            synchronized (Singleton.class){
                if(Objects.isNull(singleton)) {
                    singleton = new Singleton();
                }
            }
        }
       return singleton;
    }
}
